﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace eDepotSystem
{
    static public class UserBase
    {
        static private List<Driver> users = new List<Driver>{
            new Driver("GlynHughes", "123456"),
            new Driver("FlyingSpaghettiMonster", "654321"),
            new Driver("WomblesOfWimbledon", "abcdef"),
            new Driver("Dave", "098765"),
            new Driver("Bob", "567890"),
            new Driver("Dobbie", "Potter")
        };

        static public Driver GetDriver(string UserName)
        {
            return users.Find(d => d.GetUserName() == UserName);
        }

        static public bool Authenticate(string UserName, string Password)
        {
            Driver driver = GetDriver(UserName);

            if (driver != null && driver.CheckPassword(Password))
            {
                return true;
            }
            return false;
        }
    }
}
